<h1>Listing messages</h1>

<table>
  <tr>
    <th>From</th>
    <th>To</th>
    <th>Title</th>
    <th>Content</th>
  </tr>

<% @messages.each do |message| %>
  <tr>
    <td><%=h message.from_id %></td>
    <td><%=h message.to_id %></td>
    <td><%=h message.title %></td>
    <td><%=h message.content %></td>
    <td><%= link_to 'Show', message %></td>
    <td><%= link_to 'Edit', edit_message_path(message) %></td>
    <td><%= link_to 'Destroy', message, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New message', new_message_path %>